package com.ytxg.core.dto;

import lombok.Data;

import java.io.Serializable;

@Data
public class RestResp<T> implements Serializable {

    private String code;
    private String message;
    private T data;

    private RestResp() {
        this.code = "00000";
        this.message = "正常";
    }

    private RestResp(T data){
        this();
        this.data = data;
    }

    public static RestResp<Void> ok(){
        return new RestResp<>();
    }

    public static <T> RestResp<T> ok(T data){
        return new RestResp<T>(data);
    }
}
